Namespacing everything to /UVa.
[andmenj-acm.git] / UVa / 10815 - Andy's first dictionary / 10815.cpp
blobbdf6229832cb2413901c1c3ed36e1c62428d666f
1 #include <iostream>
2 #include <string>
3 #include <set>
4 #include <vector>
5 #include <sstream>
6 using namespace std;
8 typedef set<string> words;
10 int main(){
11 words w;
12 string s;
13 while (getline(cin, s)){
14 for (int i=0; i<s.size(); ++i){
15 s[i] = tolower(s[i]);
16 if (!isalpha(s[i])) s[i] = ' ';
18 stringstream ss(s);
19 while (ss >> s){
20 w.insert(s);
23 for (words::iterator i = w.begin(); i != w.end(); ++i){
24 cout << (*i) << endl;
26 return 0;